const proxyObj = {};
const targetURL = "http://localhost:8090";

// 跨域配置
proxyObj['/api'] = {
  ws: false,
  target: targetURL,    // 请求转发后的请求地址
  changeOrigin: true,
  pathRewrite: {
    '^/api': ''
  }
};

module.exports = {
  configureWebpack: {
    resolve: {
      extensions: ['.js', '.vue', '.json', '.css'],
      alias: {
        'assets': '@/assets',
        'components': '@/components',
        'views': '@/views',
        'network': '@/network'
      }
    }
  },

  devServer: {
    host: "localhost",
    port: 8080,
    proxy: proxyObj
  }

};
